How to determine a string’s length and if it contains specific characters.